home *** CD-ROM | disk | FTP | other *** search
/ This Disc Bytes! / Power Computing - The Disc 2 - This Disc Bytes.ISO / mac / CodeWarrior 7 Lite for 68K / MacOS Support / Headers / Universal Headers / ToolUtils.h < prev    next >
Text File  |  1995-07-06  |  3KB  |  137 lines

  1. /*
  2.      File:        ToolUtils.h
  3.  
  4.      Contains:    Toolbox Utilities Interfaces.
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Package:    Universal Interfaces 2.1 in “MPW Latest” on ETO #18
  8.  
  9.      Copyright:    © 1984-1995 by Apple Computer, Inc.
  10.                  All rights reserved.
  11.  
  12.      Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13.                  stack.  Include the file and version information (from above)
  14.                  in the problem description and send to:
  15.                      Internet:    apple.bugs@applelink.apple.com
  16.                      AppleLink:    APPLE.BUGS
  17.  
  18. */
  19.  
  20. #ifndef __TOOLUTILS__
  21. #define __TOOLUTILS__
  22.  
  23.  
  24. #ifndef __TYPES__
  25. #include <Types.h>
  26. #endif
  27. /*    #include <ConditionalMacros.h>                                */
  28.  
  29. #ifndef __OSUTILS__
  30. #include <OSUtils.h>
  31. #endif
  32. /*    #include <MixedMode.h>                                        */
  33. /*    #include <Memory.h>                                            */
  34.  
  35. #ifndef __TEXTUTILS__
  36. #include <TextUtils.h>
  37. #endif
  38. /*    #include <Script.h>                                            */
  39. /*        #include <Quickdraw.h>                                    */
  40. /*            #include <QuickdrawText.h>                            */
  41. /*        #include <IntlResources.h>                                */
  42. /*        #include <Events.h>                                        */
  43.  
  44. #ifndef __FIXMATH__
  45. #include <FixMath.h>
  46. #endif
  47. #if OLDROUTINELOCATIONS
  48.  
  49. #ifndef __QUICKDRAW__
  50. #include <Quickdraw.h>
  51. #endif
  52.  
  53. #ifndef __ICONS__
  54. #include <Icons.h>
  55. #endif
  56. #endif
  57.  
  58. #ifdef __cplusplus
  59. extern "C" {
  60. #endif
  61.  
  62. #if PRAGMA_ALIGN_SUPPORTED
  63. #pragma options align=mac68k
  64. #endif
  65.  
  66. #if PRAGMA_IMPORT_SUPPORTED
  67. #pragma import on
  68. #endif
  69.  
  70. /*
  71.     Note: 
  72.     
  73.     The following have moved to Icons.h:      PlotIcon and GetIcon
  74.     
  75.     The following have moved to Quickdraw.h: GetPattern, GetIndPattern, GetCursor, ShieldCursor, 
  76.                                              GetPicture, DeltaPoint and ScreenResGetCursor
  77. */
  78. struct Int64Bit {
  79.     SInt32                            hiLong;
  80.     UInt32                            loLong;
  81. };
  82. typedef struct Int64Bit Int64Bit;
  83.  
  84. extern pascal Fixed FixRatio(short numer, short denom)
  85.  ONEWORDINLINE(0xA869);
  86. extern pascal Fixed FixMul(Fixed a, Fixed b)
  87.  ONEWORDINLINE(0xA868);
  88. extern pascal short FixRound(Fixed x)
  89.  ONEWORDINLINE(0xA86C);
  90. extern pascal void PackBits(Ptr *srcPtr, Ptr *dstPtr, short srcBytes)
  91.  ONEWORDINLINE(0xA8CF);
  92. extern pascal void UnpackBits(Ptr *srcPtr, Ptr *dstPtr, short dstBytes)
  93.  ONEWORDINLINE(0xA8D0);
  94. extern pascal Boolean BitTst(const void *bytePtr, long bitNum)
  95.  ONEWORDINLINE(0xA85D);
  96. extern pascal void BitSet(void *bytePtr, long bitNum)
  97.  ONEWORDINLINE(0xA85E);
  98. extern pascal void BitClr(void *bytePtr, long bitNum)
  99.  ONEWORDINLINE(0xA85F);
  100. extern pascal long BitAnd(long value1, long value2)
  101.  ONEWORDINLINE(0xA858);
  102. extern pascal long BitOr(long value1, long value2)
  103.  ONEWORDINLINE(0xA85B);
  104. extern pascal long BitXor(long value1, long value2)
  105.  ONEWORDINLINE(0xA859);
  106. extern pascal long BitNot(long value)
  107.  ONEWORDINLINE(0xA85A);
  108. extern pascal long BitShift(long value, short count)
  109.  ONEWORDINLINE(0xA85C);
  110. extern pascal Fixed SlopeFromAngle(short angle)
  111.  ONEWORDINLINE(0xA8BC);
  112. extern pascal short AngleFromSlope(Fixed slope)
  113.  ONEWORDINLINE(0xA8C4);
  114. #if GENERATING68K
  115. extern pascal void LongMul(long a, long b, Int64Bit *result)
  116.  ONEWORDINLINE(0xA867);
  117. #endif
  118. #if !GENERATING68K
  119. #define LongMul(a, b, result) ((void) WideMultiply((a), (b), (wide*)(result)))
  120. #endif
  121. #define HiWord(x) ((short)((long)(x) >> 16))
  122. #define LoWord(x) ((short)(x))
  123.  
  124. #if PRAGMA_IMPORT_SUPPORTED
  125. #pragma import off
  126. #endif
  127.  
  128. #if PRAGMA_ALIGN_SUPPORTED
  129. #pragma options align=reset
  130. #endif
  131.  
  132. #ifdef __cplusplus
  133. }
  134. #endif
  135.  
  136. #endif /* __TOOLUTILS__ */
  137.